<template>
  <div>
    <DialogVue :title="'编辑标题'" v-bind="$attrs">
      <div class="container">
        <el-row>
          <el-col :span="12"
            ><div class="grid-content bg-purple">
              <FormMain
                :form-data="formData"
                @submit-event="formSubmitevent"
              ></FormMain></div
          ></el-col>

          <el-col :span="12"
            ><div class="grid-content bg-purple-light">
              <DialogEditRight
                ref="styleRef"
                :form-data="formData"
              ></DialogEditRight></div
          ></el-col>
        </el-row>
      </div>
    </DialogVue>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted, onUpdated, onBeforeUnmount } from 'vue'
import DialogVue from './DialogVue.vue'
import DialogEditRight from './DialogEditRight.vue'
import FormMain from '../form/FormMain.vue'
import emitter from '../../../mitt'
import store from '../../../store'
defineProps({
  formData: {
    type: Object,
    default: {},
  },
})
const vShow = ref(false)

const dialogData = ref({
  FormData: {
    webUrl: '默认',
    webName: '默认',
  },
  styleData: {
    icon: '',
    iconColor: '',
    iconWord: '',
  },
})
const formMainRef = ref(null)
const styleRef = ref(null)

const formSubmitevent = (newAppInfo) => {
  console.log('接受到', newAppInfo)
  store.updateApp(newAppInfo)
}
</script>

<style scoped>
.container {
  border: 1px dashed;
}
</style>
